﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Avatar.Model;
using AvatarHelper;

/// <summary>
///LocationManager 的摘要说明
/// </summary>
public static class LocationManager
{
    public static List<Area> GetLocation()
    {
        return DBHelper.GetAll<Area>(a => a.FatherID == 0, "获取省列表出错：");
    }
    public static List<Area> GetLocation(int _id)
    {
        List<Area> _list = new List<Area>();
        if (_id != 0)
        {
            _list = DBHelper.GetAll<Area>(a => a.FatherID == _id, "获取省列表出错：");
        }
        return _list;
    }
    public static Area Get(int _id)
    {
        return DBHelper.Get<Area>(a=>a.ID==_id,"获取城市地区信息出错：");
    }
}
